<!DOCTYPE html>
<script src="../resources/run-after-layout-and-paint.js"></script>
<div id="frameContainer">
  <iframe src="./resources/composited-iframe-hidden-subframe.html"></iframe>
</div>
<p>This test passes if there is no assert failure in debug builds and there is no visible
content in the iframe above after the page fully settles.
<script>
function hideFrameContainer() {
    frameContainer.style.visibility = 'hidden';
}

function showFrameContainer() {
    frameContainer.style.visibility = 'visible';
}

// We were seeing assert failure when we hid and then re-showed the iframe due
// to a stale graphics layer with an old invalidation posted by the animated
// element. To prevent regression we hide and re-show the iframe, and hide again
// to ensure the content is actually hidden.
if (window.testRunner)
    testRunner.waitUntilDone();
runAfterLayoutAndPaint(function() {
    hideFrameContainer();
    runAfterLayoutAndPaint(function() {
        showFrameContainer();
        runAfterLayoutAndPaint(function() {
            hideFrameContainer();
            if (window.testRunner)
                runAfterLayoutAndPaint(function() {
                    testRunner.notifyDone();
                });
        });
    });
});
</script>
